package com.fy.controller;

import com.fy.dao.Fy_classMapper;
import com.fy.entity.Fy_class;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/fyclass")
public class Fy_classController {
    String id = "1";
    @Resource
    Fy_classMapper fy_classMapper;
    @GetMapping("/getAll")
    public List<Fy_class> fy_classMapper(){
        return fy_classMapper.findAll();
    }
    @PostMapping("/insert")
    public String insert(String class_id,String type,String fy_name,String fy_intro,String fy_pic){
        fy_classMapper.insert_fy_class(id,type,fy_name,fy_intro,fy_pic);
        id=(Integer.valueOf(id)+1+"");
        return "200";
    }
}
